 // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
 // Jad home page: http://www.kpdus.com/jad.html
 // Decompiler options: packimports(3) 
 // Source File Name:   WebTreeRenderer.java

 package com.jb.web.renderer;

 import com.jb.faces.component.UIComponent;
 import com.jb.web.bean.JBTreeNode;
 import com.jb.web.bean.WebTree;
 import com.jb.web.context.WebContext;

 // Referenced classes of package com.jb.web.renderer:
 //            TreeNodeRenderer

 public class WebTreeRenderer extends TreeNodeRenderer
 {

     public StringBuffer renderBegin(WebContext pCtx, UIComponent itemToRender)
     {
         WebTree webTree = (WebTree)itemToRender;
         StringBuffer html = new StringBuffer("");
         String style = webTree.getStyle(pCtx);
         html.append("<div ").append(getEditScript(pCtx, webTree)).append(addTagProperty("class", webTree.getStyleClass(), null));
         if(webTree.getOnSelectNode() != null && webTree.getOnSelectNode().startsWith("client:"))
             html.append(addTagProperty("onSelectNode", webTree.getOnSelectNode().substring(7), null));
         html.append(addTagProperty("style", style, null)).append(">");
         return html;
     }

     public StringBuffer renderChildren(WebContext pCtx, UIComponent itemToRender)
     {
         WebTree webTree = (WebTree)itemToRender;
         StringBuffer html = new StringBuffer("");
         String value = webTree.getId();
         if(webTree.getRootNode() != null)
             html.append(webTree.getRootNode().render(pCtx));
         else
             html.append(value);
         return html;
     }

     public StringBuffer renderEnd(WebContext pCtx, UIComponent itemToRender)
     {
         return new StringBuffer("</div>");
     }

 }
